package simple;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.StringTokenizer;

public class SubStringTest {
	public static void main(String[] args) {
		String a = "ABCDEF";
		System.out.println(a.substring(4,5));
		System.out.println("//////////////////////");
		String temp = "Ranjith Rajamogan R";
		List<String> al = new ArrayList<String>();
		String space = " ";
		char space1 = space.charAt(0);
		for(int i=0, j=0;i<temp.length();i++){
			if(temp.charAt(i)==space1){
				al.add(temp.substring(j,i));
				j=i+1;
			}
		}
		
		System.out.println(al.get(0));
		System.out.println(al.get(1));
		//System.out.println(al.get(2));
	}
}
